import React from "react";
import { connect } from "react-redux";

import { Button } from 'antd';

import { createFront } from "../actions/nameActions.js";
import { getAction } from "../actions/actions.js";


const Authname = (props) => {

  return (
    <div>
      <p style={{ color: "HotPink", fontSize: 16, fontWeight: 500 }}>{props.sologan}</p>
      <Button type="primary" onClick={props.setN}>点击查看作者</Button>
      &nbsp;
      <Button type="danger" onClick={props.getC}>lookCode</Button>
    </div >
  )

}

const mapStateToProps = (state) => {
  return {
    sologan: state.reducerName.sologan,
  }
}

const mapDispatchToProps = (dispatch) => {
  return {
    setN: () => dispatch(createFront('曹操:')),
    getC: () => dispatch(getAction())
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(Authname);